package com.WaVel.mapper;

import com.Emplyment.entity.ResumeTemplate;
import com.Emplyment.enumeration.OperationType;
import com.Emplyment.vo.ResumeTemplateDownAndPreviewVo;
import com.Emplyment.vo.ResumeTemplateVo;
import com.WaVel.annotation.AutoFill;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface ResumeTemplateMapper {

    @Select("SELECT * FROM resume_template")
   List<ResumeTemplateVo> getResumeTemplate();

    @Delete("DELETE FROM resume_template WHERE id = #{id}")
    void deleteTemplate(Integer id);

    @Insert("INSERT INTO resume_template(name, fileType, createTime,url,size,preview_file,photo_url,down_file) VALUES(#{name}, #{fileType}, #{createTime},#{url},#{size},#{previewFile},#{photoUrl},#{downFlie})")
    void insertTemplate(ResumeTemplate resumeTemplate);

    @Select("SELECT name,preview_file FROM resume_template WHERE id = #{templateId}")
    ResumeTemplateDownAndPreviewVo ByIdGetResumeTemplate(Integer templateId);
}
